 <template>
  <div>
    123
    <ul ref="ul">
      <li v-for="(item, index) in arr" :key="index">{{ item }}</li>
    </ul>
    <button @click="add">添加</button>
  </div>
</template>
 <script>
export default {
  data() {
    return {
      arr: [1, 2],
    };
  },
  methods: {
    add() {
      this.arr.push(3);
      this.$nextTick(() => {
        console.log(this.$refs.ul.offsetHeight);
      });
    },
  },

  computed: {},
};
</script>
 <style lang='css'>
</style>